activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r359832 - /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageList.java
Date Thu, 29 Dec 2005 16:09:01 GMT
Author: jstrachan
Date: Thu Dec 29 08:08:59 2005
New Revision: 359832

URL: http://svn.apache.org/viewcvs?rev=359832&view=rev
Log:
updated javadoc

Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageList.java

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageList.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageList.java?rev=359832&r1=359831&r2=359832&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageList.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageList.java
Thu Dec 29 08:08:59 2005
@@ -27,7 +27,14 @@
 import junit.framework.Assert;
 
 /**
- * A simple container for performing testing and rendezvous style code.
+ * A simple container of messages for performing testing and rendezvous style
+ * code. You can use this class a {@link MessageListener} and then make
+ * assertions about how many messages it has received allowing a certain maximum
+ * amount of time to ensure that the test does not hang forever.
+ * 
+ * Also you can chain these instances together with the
+ * {@link #setParent(MessageListener)} method so that you can aggregate the
+ * total number of messages consumed across a number of consumers.
  * 
  * @version $Revision: 1.6 $
  */
@@ -61,7 +68,7 @@
 
     public String toString() {
         synchronized (semaphore) {
-        return messages.toString();
+            return messages.toString();
         }
     }
 
@@ -81,7 +88,7 @@
             return new ArrayList(messages);
         }
     }
-    
+
     public synchronized List getTextMessages() {
         synchronized (semaphore) {
             ArrayList l = new ArrayList();
@@ -89,8 +96,9 @@
                 try {
                     TextMessage m = (TextMessage) iter.next();
                     l.add(m.getText());
-                } catch (Throwable e) {
-                    l.add(""+e);
+                }
+                catch (Throwable e) {
+                    l.add("" + e);
                 }
             }
             return l;
@@ -163,7 +171,6 @@
         assertTrue("at most: " + messageCount + " messages received. Actual: " + actual,
actual <= messageCount);
     }
 
-
     public boolean hasReceivedMessage() {
         return getMessageCount() == 0;
     }
@@ -185,11 +192,11 @@
     }
 
     /**
-     * Allows a parent listener to be specified such as to aggregate messages consumed across
consumers
+     * Allows a parent listener to be specified such as to aggregate messages
+     * consumed across consumers
      */
     public void setParent(MessageListener parent) {
         this.parent = parent;
     }
-    
-    
+
 }



Mime
View raw message