qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r501145 - /incubator/qpid/branches/qpid.0-9/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
Date Mon, 29 Jan 2007 18:58:25 GMT
Author: rhs
Date: Mon Jan 29 10:58:24 2007
New Revision: 501145

URL: http://svn.apache.org/viewvc?view=rev&rev=501145
Log:
Fixed a broken test case.

Modified:
    incubator/qpid/branches/qpid.0-9/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java

Modified: incubator/qpid/branches/qpid.0-9/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java?view=diff&rev=501145&r1=501144&r2=501145
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
(original)
+++ incubator/qpid/branches/qpid.0-9/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
Mon Jan 29 10:58:24 2007
@@ -17,12 +17,13 @@
  */
 package org.apache.qpid.server.queue;
 
-import java.util.ArrayList;
+import java.util.Collections;
 
 import javax.management.JMException;
 
 import junit.framework.TestCase;
 
+import org.apache.mina.common.ByteBuffer;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.message.MessageHeaders;
 import org.apache.qpid.framing.Content;
@@ -49,7 +50,8 @@
         sendMessages(messageCount);
         assertTrue(_queueMBean.getMessageCount() == messageCount);
         assertTrue(_queueMBean.getReceivedMessageCount() == messageCount);
-        assertTrue(_queueMBean.getQueueDepth() == 10);
+        // each message is 1K
+        assertTrue(_queueMBean.getQueueDepth() == messageCount);
 
         _queueMBean.deleteMessageFromTop();
         assertTrue(_queueMBean.getMessageCount() == messageCount - 1);
@@ -154,14 +156,16 @@
     {
         // AMQP version change: Hardwire the version to 0-9 (major=0, minor=9)
         // TODO: Establish some way to determine the version for the test.
-                
+
         MessageHeaders messageHeaders = new MessageHeaders();
-    	
+
+        ByteBuffer buffer = ByteBuffer.wrap(new byte[1000]);
+        Content body = new Content(Content.TypeEnum.INLINE_T, buffer);
     	MessageTransferBody methodBody = MessageTransferBody.createMethodBody(
             (byte)0, (byte)9,               // AMQP version (major, minor)
             messageHeaders.getAppId(),      // String appId
             messageHeaders.getJMSHeaders(), // FieldTable applicationHeaders
-            new Content(),                        // Content body
+            body,                           // Content body
             messageHeaders.getEncoding(),   // String contentEncoding
             messageHeaders.getContentType(), // String contentType
             messageHeaders.getCorrelationId(), // String correlationId
@@ -181,8 +185,8 @@
             messageHeaders.getTransactionId(), // String transactionId
             0,                              // long ttl
             messageHeaders.getUserId());    // String userId
-    	
-    	return new AMQMessage(_messageStore, methodBody, new ArrayList()); 
+
+    	return new AMQMessage(_messageStore, methodBody, Collections.singletonList(buffer));
     }
 
     @Override



Mime
View raw message