activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r359830 - in /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq: broker/policy/StrictOrderDispatchPolicyTest.java util/MessageList.java
Date Thu, 29 Dec 2005 16:07:04 GMT
Author: jstrachan
Date: Thu Dec 29 08:07:01 2005
New Revision: 359830

URL: http://svn.apache.org/viewcvs?rev=359830&view=rev
Log:
fixed up test cases after they broker with the MessageList refactor

Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
    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/broker/policy/StrictOrderDispatchPolicyTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java?rev=359830&r1=359829&r2=359830&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
Thu Dec 29 08:07:01 2005
@@ -21,6 +21,7 @@
 import org.apache.activemq.broker.region.policy.PolicyEntry;
 import org.apache.activemq.broker.region.policy.PolicyMap;
 import org.apache.activemq.broker.region.policy.StrictOrderDispatchPolicy;
+import org.apache.activemq.util.MessageList;
 
 import java.util.List;
 import java.util.Iterator;
@@ -97,10 +98,10 @@
 
         // Get basis of order
         Iterator i = consumers.keySet().iterator();
-        List messageOrder = (List)consumers.get(i.next());
+        MessageList messageOrder = (MessageList)consumers.get(i.next());
 
         for (;i.hasNext();) {
-            List messageList = (List)consumers.get(i.next());
+            MessageList messageList = (MessageList)consumers.get(i.next());
             assertTrue("Messages are not ordered.", messageOrder.equals(messageList));
         }
     }

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=359830&r1=359829&r2=359830&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:07:01 2005
@@ -16,14 +16,14 @@
  */
 package org.apache.activemq.util;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 import javax.jms.Message;
 import javax.jms.MessageListener;
 import javax.jms.TextMessage;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 import junit.framework.Assert;
 
 /**
@@ -43,6 +43,26 @@
 
     public MessageList(Object semaphore) {
         this.semaphore = semaphore;
+    }
+
+    public boolean equals(Object that) {
+        if (that instanceof MessageList) {
+            MessageList thatList = (MessageList) that;
+            return getMessages().equals(thatList.getMessages());
+        }
+        return false;
+    }
+
+    public int hashCode() {
+        synchronized (semaphore) {
+            return messages.hashCode() + 1;
+        }
+    }
+
+    public String toString() {
+        synchronized (semaphore) {
+        return messages.toString();
+        }
     }
 
     /**



Mime
View raw message