Author: clebert.suconic(a)jboss.com
Date: 2010-12-17 19:40:00 -0500 (Fri, 17 Dec 2010)
New Revision: 10058
Modified:
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java
Log:
fixing a few tests
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-12-17 22:30:28
UTC (rev 10057)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-12-18 00:40:00
UTC (rev 10058)
@@ -1039,7 +1039,10 @@
{
currentLargeMessage.releaseResources();
- currentLargeMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE,
messageBodySize);
+ if (messageBodySize >= 0)
+ {
+ currentLargeMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE,
messageBodySize);
+ }
doSend(currentLargeMessage, false);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java 2010-12-17
22:30:28 UTC (rev 10057)
+++ trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java 2010-12-18
00:40:00 UTC (rev 10058)
@@ -2629,14 +2629,18 @@
try
{
LargeServerMessageImpl fileMessage = new
LargeServerMessageImpl((JournalStorageManager)server.getStorageManager());
-
+
fileMessage.setMessageID(1005);
for (int i = 0; i < LARGE_MESSAGE_SIZE; i++)
{
fileMessage.addBytes(new byte[] { UnitTestCase.getSamplebyte(i) });
}
+
+ // The server would be doing this
+ fileMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE, LARGE_MESSAGE_SIZE);
+
fileMessage.releaseResources();
session.createQueue(LargeMessageTest.ADDRESS, LargeMessageTest.ADDRESS, true);
Modified:
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java 2010-12-17
22:30:28 UTC (rev 10057)
+++
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java 2010-12-18
00:40:00 UTC (rev 10058)
@@ -15,7 +15,14 @@
import junit.framework.Assert;
-import org.hornetq.api.core.client.*;
+import org.hornetq.api.core.Message;
+import org.hornetq.api.core.client.ClientConsumer;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.persistence.impl.journal.LargeServerMessageImpl;
import org.hornetq.core.server.HornetQServer;
@@ -65,7 +72,10 @@
{
fileMessage.addBytes(new byte[] { UnitTestCase.getSamplebyte(i) });
}
+ // The server would be doing this
+ fileMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE, 2 *
HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
+
fileMessage.releaseResources();
session.createQueue("A", "A");
Show replies by date