You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2018/03/19 22:13:07 UTC
qpid-broker-j git commit: NO-JIRA: [Broker-J] [Protocol Test AMQP
0-8] Fix sporadically failing
org.apache.qpid.tests.protocol.v0_8.ConnectionTest#overlySizedContentBodyFrame
Repository: qpid-broker-j
Updated Branches:
refs/heads/master a1bf40bf2 -> 330a71cdc
NO-JIRA: [Broker-J] [Protocol Test AMQP 0-8] Fix sporadically failing org.apache.qpid.tests.protocol.v0_8.ConnectionTest#overlySizedContentBodyFrame
Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/330a71cd
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/330a71cd
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/330a71cd
Branch: refs/heads/master
Commit: 330a71cdc7d5c5c1d1a0c83500ce51a50e6b649b
Parents: a1bf40b
Author: Keith Wall <kw...@apache.org>
Authored: Mon Mar 19 22:12:35 2018 +0000
Committer: Keith Wall <kw...@apache.org>
Committed: Mon Mar 19 22:12:39 2018 +0000
----------------------------------------------------------------------
.../tests/protocol/v0_8/ConnectionTest.java | 28 ++++++++++++++++----
1 file changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/330a71cd/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/ConnectionTest.java
----------------------------------------------------------------------
diff --git a/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/ConnectionTest.java b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/ConnectionTest.java
index 97227f2..a05874f 100644
--- a/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/ConnectionTest.java
+++ b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/ConnectionTest.java
@@ -33,9 +33,11 @@ import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assume.assumeThat;
+import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
+import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Test;
@@ -346,13 +348,29 @@ public class ConnectionTest extends BrokerAdminUsingTestBase
.consumeResponse(ChannelOpenOkBody.class)
.basic().publish()
.basic().contentHeader(bodyBytes.length)
- .basic().contentBody(bodyBytes)
- .sync();
+ .basic().contentBody(bodyBytes);
- final ChannelClosedResponse closeResponse = interaction.consumeResponse()
- .getLatestResponse(ChannelClosedResponse.class);
- //TODO: The ChannelClosedResponse is wrong.
+ // Spec requires:
//assertThat(res.getReplyCode(), CoreMatchers.is(CoreMatchers.equalTo(ErrorCodes.COMMAND_INVALID)));
+
+ // Server actually abruptly closes the connection. We might see a graceful TCP/IP close or a broken pipe.
+ try
+ {
+ final ChannelClosedResponse closeResponse = interaction.consumeResponse()
+ .getLatestResponse(ChannelClosedResponse.class);
+ }
+ catch (ExecutionException e)
+ {
+ Throwable original = ((ExecutionException) e).getCause();
+ if (original instanceof IOException)
+ {
+ // PASS
+ }
+ else
+ {
+ throw new RuntimeException(original);
+ }
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org