qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject [4/7] qpid-jms git commit: QPIDJMS-75: update header handler to treat assertion errors in line with frame handlers
Date Mon, 22 Jun 2015 16:32:16 GMT
QPIDJMS-75: update header handler to treat assertion errors in line with frame handlers


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/78b8ea75
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/78b8ea75
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/78b8ea75

Branch: refs/heads/master
Commit: 78b8ea7586dcbba5914600f427ca8590b17736d5
Parents: db79364
Author: Robert Gemmell <robbie@apache.org>
Authored: Mon Jun 22 15:12:03 2015 +0100
Committer: Robert Gemmell <robbie@apache.org>
Committed: Mon Jun 22 17:28:07 2015 +0100

----------------------------------------------------------------------
 .../qpid/jms/test/testpeer/HeaderHandlerImpl.java  | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/78b8ea75/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/HeaderHandlerImpl.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/HeaderHandlerImpl.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/HeaderHandlerImpl.java
index f981b34..66cabf8 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/HeaderHandlerImpl.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/HeaderHandlerImpl.java
@@ -50,12 +50,27 @@ class HeaderHandlerImpl implements HeaderHandler
     {
         LOGGER.debug("About to check received header {}", new Binary(header));
 
-        assertThat("Header should match", header, equalTo(_expectedHeader));
+        try
+        {
+            assertThat("Header should match", header, equalTo(_expectedHeader));
+        }
+        catch(AssertionError ae)
+        {
+            LOGGER.error("Failure when verifying header", ae);
+            peer.assertionFailed(ae);
+        }
+
+        LOGGER.debug("Sending header response.");
         peer.sendHeader(_response);
+
         if(_onCompletion != null)
         {
             _onCompletion.run();
         }
+        else
+        {
+            LOGGER.debug("No onCompletion action, doing nothing.");
+        }
     }
 
     @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message