Author: robbie
Date: Fri Jul 18 10:40:55 2014
New Revision: 1611582

URL: http://svn.apache.org/r1611582
Log:
NO-JIRA: improve output of channel info when the matcher fails, help clarify 
what didnt meet expectation

Modified:
    
qpid/jms/trunk/src/test/java/org/apache/qpid/jms/test/testpeer/FrameMatchingHandler.java

Modified: 
qpid/jms/trunk/src/test/java/org/apache/qpid/jms/test/testpeer/FrameMatchingHandler.java
URL: 
http://svn.apache.org/viewvc/qpid/jms/trunk/src/test/java/org/apache/qpid/jms/test/testpeer/FrameMatchingHandler.java?rev=1611582&r1=1611581&r2=1611582&view=diff
==============================================================================
--- 
qpid/jms/trunk/src/test/java/org/apache/qpid/jms/test/testpeer/FrameMatchingHandler.java
 (original)
+++ 
qpid/jms/trunk/src/test/java/org/apache/qpid/jms/test/testpeer/FrameMatchingHandler.java
 Fri Jul 18 10:40:55 2014
@@ -70,7 +70,7 @@ abstract class FrameMatchingHandler impl
     public void frame(int type, int ch, DescribedType dt, Binary payload, 
TestAmqpPeer peer)
     {
         if(type == _frameType.ordinal()
-           && (_expectedChannel == -1 || _expectedChannel == ch)
+           && (_expectedChannel == ANY_CHANNEL || _expectedChannel == ch)
            && (_numericDescriptor.equals(dt.getDescriptor()) || 
_symbolicDescriptor.equals(dt.getDescriptor()))
            && (dt.getDescribed() instanceof List))
         {
@@ -84,11 +84,16 @@ abstract class FrameMatchingHandler impl
                     "Frame was not as expected. Expected: " +
                     "type=%s, channel=%s, descriptor=%s/%s but got: " +
                     "type=%s, channel=%s, descriptor=%s",
-                    _frameType.ordinal(), _expectedChannel, 
_symbolicDescriptor, _numericDescriptor,
+                    _frameType.ordinal(), expectedChannelString(), 
_symbolicDescriptor, _numericDescriptor,
                     type, ch, dt.getDescriptor()));
         }
     }
 
+    private String expectedChannelString()
+    {
+        return _expectedChannel == ANY_CHANNEL ? "<any>" : 
String.valueOf(_expectedChannel);
+    }
+
     private void succeeded()
     {
         if(_onSuccessAction != null)
@@ -135,7 +140,7 @@ abstract class FrameMatchingHandler impl
     public String toString()
     {
         return "FrameMatchingHandler [_symbolicDescriptor=" + 
_symbolicDescriptor
-                + ", _expectedChannel=" + (_expectedChannel == ANY_CHANNEL ? 
"<any>":String.valueOf(_expectedChannel))
+                + ", _expectedChannel=" + expectedChannelString()
                 + "]";
     }
 }
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to