Author: borges
Date: 2011-06-17 11:50:19 -0400 (Fri, 17 Jun 2011)
New Revision: 10847
Added:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/CreateMessage.java
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ExpiryAddressTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessagePriorityTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/WildCardRoutingTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/HornetQServerControlTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/security/SecurityTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQRecoveryTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/BasicXaTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/XaTimeoutTest.java
trunk/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java
Log:
Move CreateMessage utility methods to own class, removing JMS dependencies from base
TestCases.
(allowing unit-testing code to be moved to hornetq-core/src/tests.)
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -27,6 +27,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -82,7 +83,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -116,7 +117,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -150,7 +151,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -188,7 +189,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -228,7 +229,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
session.close();
@@ -293,7 +294,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -37,6 +37,7 @@
import org.hornetq.core.server.Consumer;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.impl.ServerConsumerImpl;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -434,7 +435,7 @@
for (int i = 0; i < numberOfMessages; i++)
{
- prod.send(createTextMessage(session, "Msg" + i));
+ prod.send(CreateMessage.createTextMessage(session, "Msg" + i,
true));
}
for (int i = 0; i < numberOfMessages - 1; i++)
@@ -534,7 +535,7 @@
// or the client will be buffering messages
Assert.assertNull(consNeverUsed.receive(1));
- ClientMessage msg = createTextMessage(session, "This one will
expire");
+ ClientMessage msg = CreateMessage.createTextMessage(session, "This one will
expire", true);
if (largeMessages)
{
msg.getBodyBuffer().writeBytes(new byte[600]);
@@ -543,7 +544,7 @@
msg.setExpiration(System.currentTimeMillis() + 100);
prod.send(msg);
- msg = createTextMessage(session, "First-on-non-buffered");
+ msg = CreateMessage.createTextMessage(session,
"First-on-non-buffered", true);
prod.send(msg);
@@ -560,7 +561,7 @@
for (int i = 0; i < numberOfMessages; i++)
{
- msg = createTextMessage(session, "Msg" + i);
+ msg = CreateMessage.createTextMessage(session, "Msg" + i, true);
if (largeMessages)
{
@@ -665,7 +666,7 @@
for (int i = 0; i < numberOfMessages; i++)
{
- ClientMessage msg = createTextMessage(session1, "Msg" + i);
+ ClientMessage msg = CreateMessage.createTextMessage(session1, "Msg"
+ i, true);
if (largeMessages)
{
msg.getBodyBuffer().writeBytes(new byte[600]);
@@ -736,7 +737,7 @@
for (int i = 0; i < numberOfMessages; i++)
{
- ClientMessage msg = createTextMessage(session1, "Msg" + i);
+ ClientMessage msg = CreateMessage.createTextMessage(session1, "Msg"
+ i, true);
if (largeMessages)
{
msg.getBodyBuffer().writeBytes(new byte[600]);
@@ -1009,7 +1010,7 @@
for (int i = 0; i < numberOfMessages; i++)
{
- ClientMessage msg = createTextMessage(session, "Msg" + i);
+ ClientMessage msg = CreateMessage.createTextMessage(session, "Msg"
+ i, true);
if (largeMessages)
{
msg.getBodyBuffer().writeBytes(new byte[600]);
@@ -1171,7 +1172,7 @@
for (int i = 0; i < numberOfMessages; i++)
{
- ClientMessage msg = createTextMessage(session, "Msg" + i);
+ ClientMessage msg = CreateMessage.createTextMessage(session, "Msg"
+ i, true);
if (largeMessage)
{
msg.getBodyBuffer().writeBytes(new byte[600]);
@@ -1319,7 +1320,7 @@
for (int i = 0; i < numberOfMessages; i++)
{
- ClientMessage msg = createTextMessage(sessionA, "Msg" + i);
+ ClientMessage msg = CreateMessage.createTextMessage(sessionA, "Msg"
+ i, true);
if (largeMessages)
{
msg.getBodyBuffer().writeBytes(new byte[600]);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -37,6 +37,7 @@
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.server.Queue;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
@@ -65,7 +66,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(CreateMessage.createTextMessage("heyho!", clientSession));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -95,7 +96,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(CreateMessage.createTextMessage("heyho!", clientSession));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(5000);
@@ -132,7 +133,7 @@
clientSession.createQueue(dla, dlq, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(CreateMessage.createTextMessage("heyho!", clientSession));
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
final CountDownLatch latch = new CountDownLatch(2);
TestHandler handler = new TestHandler(latch, clientSession);
@@ -189,7 +190,7 @@
clientSession.createQueue(dla, dlq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(CreateMessage.createTextMessage("heyho!", clientSession));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -223,7 +224,7 @@
server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(CreateMessage.createTextMessage("heyho!", clientSession));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
ClientMessage m = clientConsumer.receive(500);
@@ -258,7 +259,7 @@
for (int i = 0; i < NUM_MESSAGES; i++)
{
- ClientMessage tm = createTextMessage("Message:" + i, clientSession);
+ ClientMessage tm = CreateMessage.createTextMessage("Message:" + i,
clientSession);
producer.send(tm);
}
@@ -339,7 +340,7 @@
clientSession.createQueue(deadLetterAdress, deadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
producer.send(clientMessage);
clientSession.start();
@@ -381,7 +382,7 @@
clientSession.createQueue(deadLetterAdress, deadLetterQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
producer.send(clientMessage);
clientSession.start();
@@ -430,7 +431,7 @@
clientSession.createQueue(specificDeadLetterAddress, specificDeadLetterQueue,
false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
producer.send(clientMessage);
clientSession.start();
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ExpiryAddressTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -25,6 +25,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
@@ -53,7 +54,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -84,7 +85,7 @@
clientSession.createQueue(ea, eq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -136,7 +137,7 @@
clientSession.createQueue(ea, eq2, null, false);
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
clientSession.start();
@@ -167,7 +168,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < NUM_MESSAGES; i++)
{
- ClientMessage tm = createTextMessage("Message:" + i, clientSession);
+ ClientMessage tm = CreateMessage.createTextMessage("Message:" + i,
clientSession);
tm.setExpiration(expiration);
producer.send(tm);
}
@@ -212,7 +213,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -241,7 +242,7 @@
clientSession.createQueue(qName, qName, null, false);
ClientProducer producer = clientSession.createProducer(qName);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
@@ -279,7 +280,7 @@
clientSession.createQueue(specificExpiryAddress, specificExpiryQueue, false);
ClientProducer producer = clientSession.createProducer(address);
- ClientMessage clientMessage = createTextMessage("heyho!",
clientSession);
+ ClientMessage clientMessage = CreateMessage.createTextMessage("heyho!",
clientSession);
clientMessage.setExpiration(System.currentTimeMillis());
producer.send(clientMessage);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -18,6 +18,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -75,7 +76,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -27,6 +27,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
@@ -64,7 +65,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
clientProducer.send(message);
}
CountDownLatch latch = new CountDownLatch(numMessages);
@@ -91,7 +92,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
clientProducer.send(message);
clientProducer2.send(message);
clientProducer3.send(message);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageGroupingTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -32,6 +32,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.UnitTestCase;
/**
@@ -99,7 +100,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
clientProducer.send(message);
}
@@ -131,7 +132,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -174,7 +175,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -222,7 +223,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -283,7 +284,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -358,7 +359,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -419,7 +420,7 @@
int numMessages = 100;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
@@ -493,7 +494,7 @@
int numMessages = 4;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, clientSession);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0 || i == 0)
{
message.putStringProperty(Message.HDR_GROUP_ID, groupId);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -21,6 +21,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -74,7 +75,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -135,7 +136,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
@@ -237,7 +238,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -325,7 +326,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessagePriorityTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -29,6 +29,7 @@
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
@@ -72,7 +73,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = CreateMessage.createTextMessage(Integer.toString(i),
session);
m.setPriority((byte)i);
producer.send(m);
}
@@ -114,7 +115,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = CreateMessage.createTextMessage(Integer.toString(i),
session);
m.setPriority((byte)i);
producer.send(m);
}
@@ -153,28 +154,28 @@
// 3 7
// 3 3
// 1 9
- messages[0] = createTextMessage("a", session);
+ messages[0] = CreateMessage.createTextMessage("a", session);
messages[0].setPriority((byte)0);
- messages[1] = createTextMessage("b", session);
+ messages[1] = CreateMessage.createTextMessage("b", session);
messages[1].setPriority((byte)0);
- messages[2] = createTextMessage("c", session);
+ messages[2] = CreateMessage.createTextMessage("c", session);
messages[2].setPriority((byte)0);
- messages[3] = createTextMessage("d", session);
+ messages[3] = CreateMessage.createTextMessage("d", session);
messages[3].setPriority((byte)7);
- messages[4] = createTextMessage("e", session);
+ messages[4] = CreateMessage.createTextMessage("e", session);
messages[4].setPriority((byte)7);
- messages[5] = createTextMessage("f", session);
+ messages[5] = CreateMessage.createTextMessage("f", session);
messages[5].setPriority((byte)7);
- messages[6] = createTextMessage("g", session);
+ messages[6] = CreateMessage.createTextMessage("g", session);
messages[6].setPriority((byte)3);
- messages[7] = createTextMessage("h", session);
+ messages[7] = CreateMessage.createTextMessage("h", session);
messages[7].setPriority((byte)3);
- messages[8] = createTextMessage("i", session);
+ messages[8] = CreateMessage.createTextMessage("i", session);
messages[8].setPriority((byte)3);
- messages[9] = createTextMessage("j", session);
+ messages[9] = CreateMessage.createTextMessage("j", session);
messages[9].setPriority((byte)9);
for (int i = 0; i < 10; i++)
@@ -222,7 +223,7 @@
for (int i = 0; i < 10; i++)
{
- ClientMessage m = createTextMessage(Integer.toString(i), session);
+ ClientMessage m = CreateMessage.createTextMessage(Integer.toString(i),
session);
m.setPriority((byte)i);
producer.send(m);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/NewDeadLetterAddressTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -23,6 +23,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.UnitTestCase;
/**
@@ -51,7 +52,7 @@
SimpleString dlq = new SimpleString("DLQ1");
clientSession.createQueue(dla, dlq, null, false);
ClientProducer producer = clientSession.createProducer(address);
- producer.send(createTextMessage("heyho!", clientSession));
+ producer.send(CreateMessage.createTextMessage("heyho!", clientSession));
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(dlq);
ClientMessage m = clientConsumer.receive(500);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -20,6 +20,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -77,7 +78,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -124,7 +125,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("x"), i);
producer.send(message);
}
@@ -172,7 +173,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
if (i % 2 == 0)
{
message.putStringProperty(new SimpleString("color"), new
SimpleString("RED"));
@@ -210,7 +211,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -248,7 +249,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("x"), i);
producer.send(message);
}
@@ -303,7 +304,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
@@ -338,7 +339,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -29,6 +29,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.server.Queue;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -247,7 +248,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
producer.send(message);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -35,6 +35,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -97,7 +98,7 @@
for (int i = 0; i < 10; i++)
{
- prod.send(createTextMessage(session, Integer.toString(i), persistent));
+ prod.send(CreateMessage.createTextMessage(session, Integer.toString(i),
persistent));
}
session.commit();
@@ -196,7 +197,7 @@
RedeliveryConsumerTest.log.info("created");
ClientProducer prod = session.createProducer(ADDRESS);
- prod.send(createTextMessage(session, "Hello"));
+ prod.send(CreateMessage.createTextMessage(session, "Hello", true));
session.commit();
session.close();
@@ -251,7 +252,7 @@
RedeliveryConsumerTest.log.info("created");
ClientProducer prod = session.createProducer(ADDRESS);
- prod.send(createTextMessage(session, "Hello"));
+ prod.send(CreateMessage.createTextMessage(session, "Hello", true));
session.commit();
session.close();
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -21,6 +21,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -74,7 +75,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -118,7 +119,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -165,7 +166,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -255,7 +256,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -353,7 +354,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -455,7 +456,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -572,7 +573,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -625,7 +626,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
@@ -666,7 +667,7 @@
for (int i = 0; i < numMessages; i++)
{
- ClientMessage message = createTextMessage("m" + i, session);
+ ClientMessage message = CreateMessage.createTextMessage("m" + i,
session);
message.putIntProperty(new SimpleString("i"), i);
producer.send(message);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/WildCardRoutingTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -22,6 +22,7 @@
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.UnitTestCase;
/**
@@ -49,8 +50,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -74,8 +75,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -107,8 +108,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -148,8 +149,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -177,8 +178,8 @@
clientSession.createQueue(addressAB, queueName1, null, false);
clientSession.createQueue(addressAC, queueName2, null, false);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -209,8 +210,8 @@
clientSession.deleteQueue(queueName1);
// the wildcard binding should still exist
Assert.assertEquals(server.getPostOffice().getBindingsForAddress(addressAB).getBindings().size(),
1);
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -259,15 +260,15 @@
ClientProducer producer = clientSession.createProducer();
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(addressAB, createTextMessage("m1", clientSession));
- producer.send(addressAC, createTextMessage("m2", clientSession));
- producer.send(addressAD, createTextMessage("m3", clientSession));
- producer.send(addressAE, createTextMessage("m4", clientSession));
- producer.send(addressAF, createTextMessage("m5", clientSession));
- producer.send(addressAG, createTextMessage("m6", clientSession));
- producer.send(addressAH, createTextMessage("m7", clientSession));
- producer.send(addressAJ, createTextMessage("m8", clientSession));
- producer.send(addressAK, createTextMessage("m9", clientSession));
+ producer.send(addressAB, CreateMessage.createTextMessage("m1",
clientSession));
+ producer.send(addressAC, CreateMessage.createTextMessage("m2",
clientSession));
+ producer.send(addressAD, CreateMessage.createTextMessage("m3",
clientSession));
+ producer.send(addressAE, CreateMessage.createTextMessage("m4",
clientSession));
+ producer.send(addressAF, CreateMessage.createTextMessage("m5",
clientSession));
+ producer.send(addressAG, CreateMessage.createTextMessage("m6",
clientSession));
+ producer.send(addressAH, CreateMessage.createTextMessage("m7",
clientSession));
+ producer.send(addressAJ, CreateMessage.createTextMessage("m8",
clientSession));
+ producer.send(addressAK, CreateMessage.createTextMessage("m9",
clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
@@ -356,15 +357,15 @@
ClientProducer producer = clientSession.createProducer();
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(addressAB, createTextMessage("m1", clientSession));
- producer.send(addressAC, createTextMessage("m2", clientSession));
- producer.send(addressAD, createTextMessage("m3", clientSession));
- producer.send(addressAE, createTextMessage("m4", clientSession));
- producer.send(addressAF, createTextMessage("m5", clientSession));
- producer.send(addressAG, createTextMessage("m6", clientSession));
- producer.send(addressAH, createTextMessage("m7", clientSession));
- producer.send(addressAJ, createTextMessage("m8", clientSession));
- producer.send(addressAK, createTextMessage("m9", clientSession));
+ producer.send(addressAB, CreateMessage.createTextMessage("m1",
clientSession));
+ producer.send(addressAC, CreateMessage.createTextMessage("m2",
clientSession));
+ producer.send(addressAD, CreateMessage.createTextMessage("m3",
clientSession));
+ producer.send(addressAE, CreateMessage.createTextMessage("m4",
clientSession));
+ producer.send(addressAF, CreateMessage.createTextMessage("m5",
clientSession));
+ producer.send(addressAG, CreateMessage.createTextMessage("m6",
clientSession));
+ producer.send(addressAH, CreateMessage.createTextMessage("m7",
clientSession));
+ producer.send(addressAJ, CreateMessage.createTextMessage("m8",
clientSession));
+ producer.send(addressAK, CreateMessage.createTextMessage("m9",
clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
@@ -433,8 +434,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -462,8 +463,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -492,8 +493,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -521,8 +522,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -550,8 +551,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -575,8 +576,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -602,8 +603,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m2", m.getBodyBuffer().readString());
@@ -627,8 +628,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m2", m.getBodyBuffer().readString());
@@ -652,8 +653,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -677,8 +678,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -702,8 +703,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
@@ -730,8 +731,8 @@
ClientProducer producer2 = clientSession.createProducer(addressAC);
ClientConsumer clientConsumer = clientSession.createConsumer(queueName);
clientSession.start();
- producer.send(createTextMessage("m1", clientSession));
- producer2.send(createTextMessage("m2", clientSession));
+ producer.send(CreateMessage.createTextMessage("m1", clientSession));
+ producer2.send(CreateMessage.createTextMessage("m2", clientSession));
ClientMessage m = clientConsumer.receive(500);
Assert.assertNotNull(m);
Assert.assertEquals("m1", m.getBodyBuffer().readString());
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/HornetQServerControlTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -45,6 +45,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.UUIDGenerator;
@@ -722,10 +723,10 @@
ClientSession clientSession = csf.createSession(true, false, false);
clientSession.createQueue(atestq, atestq, null, true);
- ClientMessage m1 = createTextMessage(clientSession, "");
- ClientMessage m2 = createTextMessage(clientSession, "");
- ClientMessage m3 = createTextMessage(clientSession, "");
- ClientMessage m4 = createTextMessage(clientSession, "");
+ ClientMessage m1 = CreateMessage.createTextMessage(clientSession, "",
true);
+ ClientMessage m2 = CreateMessage.createTextMessage(clientSession, "",
true);
+ ClientMessage m3 = CreateMessage.createTextMessage(clientSession, "",
true);
+ ClientMessage m4 = CreateMessage.createTextMessage(clientSession, "",
true);
m1.putStringProperty("m1", "m1");
m2.putStringProperty("m2", "m2");
m3.putStringProperty("m3", "m3");
@@ -767,10 +768,10 @@
ClientSession clientSession = csf.createSession(true, false, false);
clientSession.createQueue(atestq, atestq, null, true);
- ClientMessage m1 = createTextMessage(clientSession, "");
- ClientMessage m2 = createTextMessage(clientSession, "");
- ClientMessage m3 = createTextMessage(clientSession, "");
- ClientMessage m4 = createTextMessage(clientSession, "");
+ ClientMessage m1 = CreateMessage.createTextMessage(clientSession, "",
true);
+ ClientMessage m2 = CreateMessage.createTextMessage(clientSession, "",
true);
+ ClientMessage m3 = CreateMessage.createTextMessage(clientSession, "",
true);
+ ClientMessage m4 = CreateMessage.createTextMessage(clientSession, "",
true);
m1.putStringProperty("m1", "m1");
m2.putStringProperty("m2", "m2");
m3.putStringProperty("m3", "m3");
@@ -809,7 +810,7 @@
ClientSession clientSession = csf.createSession(true, false, false);
clientSession.createQueue(recQueue, recQueue, null, true);
clientSession.createQueue(sendQueue, sendQueue, null, true);
- ClientMessage m1 = createTextMessage(clientSession, "");
+ ClientMessage m1 = CreateMessage.createTextMessage(clientSession, "",
true);
m1.putStringProperty("m1", "m1");
ClientProducer clientProducer = clientSession.createProducer(recQueue);
clientProducer.send(m1);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -21,6 +21,7 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -81,7 +82,7 @@
for (int i = 0; i < 100; i++)
{
- ClientMessage msg = createBytesMessage(session, new byte[0], true);
+ ClientMessage msg = CreateMessage.createBytesMessage(session, new byte[0],
true);
prod.send(msg);
}
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/security/SecurityTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/security/SecurityTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/security/SecurityTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -41,6 +41,7 @@
import org.hornetq.core.settings.HierarchicalRepository;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.spi.core.security.JAASSecurityManager;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
import org.jboss.security.SimpleGroup;
@@ -870,8 +871,8 @@
ClientSession sendingSession = cf.createSession("auser",
"pass", false, false, false, false, 0);
ClientProducer prod = sendingSession.createProducer(SecurityTest.addressA);
- prod.send(createTextMessage(sendingSession, "Test", true));
- prod.send(createTextMessage(sendingSession, "Test", true));
+ prod.send(CreateMessage.createTextMessage(sendingSession, "Test",
true));
+ prod.send(CreateMessage.createTextMessage(sendingSession, "Test",
true));
try
{
sendingSession.commit();
@@ -890,8 +891,8 @@
sendingSession.start(xid, XAResource.TMNOFLAGS);
prod = sendingSession.createProducer(SecurityTest.addressA);
- prod.send(createTextMessage(sendingSession, "Test", true));
- prod.send(createTextMessage(sendingSession, "Test", true));
+ prod.send(CreateMessage.createTextMessage(sendingSession, "Test",
true));
+ prod.send(CreateMessage.createTextMessage(sendingSession, "Test",
true));
sendingSession.end(xid, XAResource.TMSUCCESS);
try
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -31,6 +31,7 @@
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.server.Queue;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
@@ -59,7 +60,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = CreateMessage.createTextMessage("m" + i,
clientSession);
m.setExpiration(expiration);
producer.send(m);
}
@@ -80,10 +81,10 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = CreateMessage.createTextMessage("m" + i,
clientSession);
m.setExpiration(expiration);
producer.send(m);
- m = createTextMessage("m" + i, clientSession);
+ m = CreateMessage.createTextMessage("m" + i, clientSession);
m.setExpiration(expiration);
producer2.send(m);
}
@@ -99,7 +100,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = CreateMessage.createTextMessage("m" + i,
clientSession);
if (i % 2 == 0)
{
m.setExpiration(expiration);
@@ -119,7 +120,7 @@
long expiration = System.currentTimeMillis() + 1000;
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = CreateMessage.createTextMessage("m" + i,
clientSession);
m.setExpiration(expiration);
producer.send(m);
}
@@ -151,7 +152,7 @@
long expiration = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
- ClientMessage m = createTextMessage("m" + i, clientSession);
+ ClientMessage m = CreateMessage.createTextMessage("m" + i,
clientSession);
m.setExpiration(expiration);
producer.send(m);
}
@@ -190,7 +191,7 @@
long sendMessagesUntil = System.currentTimeMillis() + 2000;
do
{
- ClientMessage m = createTextMessage("m" + numMessages++,
clientSession);
+ ClientMessage m = CreateMessage.createTextMessage("m" + numMessages++,
clientSession);
m.setExpiration(expiration);
producer.send(m);
Thread.sleep(100);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQRecoveryTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -26,6 +26,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -55,13 +56,13 @@
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
clientSessionXa.start(xid, XAResource.TMNOFLAGS);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -94,22 +95,22 @@
ClientConsumer consumer = clientSessionXa.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSessionXa.start(xid, XAResource.TMNOFLAGS);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/server/LVQTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -24,6 +24,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
@@ -50,10 +51,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -70,13 +71,13 @@
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -97,10 +98,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
clientSession.start();
@@ -119,10 +120,10 @@
{
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
clientSession.start();
@@ -146,17 +147,17 @@
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
clientSession.start();
producer.send(m1);
@@ -198,10 +199,10 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
SimpleString rh = new SimpleString("SMID1");
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -218,13 +219,13 @@
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -250,13 +251,13 @@
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
SimpleString messageId2 = new SimpleString("SMID2");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId2);
producer.send(m1);
producer.send(m2);
@@ -295,7 +296,7 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString messageId1 = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
producer.send(m1);
clientSessionTxReceives.start();
@@ -315,17 +316,17 @@
ClientProducer producer = clientSessionTxSends.createProducer(address);
ClientConsumer consumer = clientSessionTxSends.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);
@@ -346,22 +347,22 @@
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
producer.send(m1);
@@ -384,22 +385,22 @@
ClientProducer producer = clientSessionTxSends.createProducer(address);
ClientConsumer consumer = clientSessionTxSends.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
producer.send(m1);
@@ -423,22 +424,22 @@
ClientProducer producer = clientSession.createProducer(address);
ClientConsumer consumer = clientSession.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSession.start();
@@ -479,22 +480,22 @@
ClientProducer producer = clientSessionTxReceives.createProducer(address);
ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
SimpleString rh = new SimpleString("SMID1");
- ClientMessage m1 = createTextMessage("m1", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m1.setDurable(true);
- ClientMessage m2 = createTextMessage("m2", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m2.setDurable(true);
- ClientMessage m3 = createTextMessage("m3", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
m3.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m3.setDurable(true);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
m4.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m4.setDurable(true);
- ClientMessage m5 = createTextMessage("m5", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
m5.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m5.setDurable(true);
- ClientMessage m6 = createTextMessage("m6", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
m6.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
m6.setDurable(true);
clientSessionTxReceives.start();
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/ssl/CoreClientOverSSLTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -30,6 +30,7 @@
import org.hornetq.core.remoting.impl.netty.TransportConstants;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
@@ -76,7 +77,7 @@
session.createQueue(CoreClientOverSSLTest.QUEUE, CoreClientOverSSLTest.QUEUE,
false);
ClientProducer producer = session.createProducer(CoreClientOverSSLTest.QUEUE);
- ClientMessage message = createTextMessage(text, session);
+ ClientMessage message = CreateMessage.createTextMessage(text, session);
producer.send(message);
ClientConsumer consumer = session.createConsumer(CoreClientOverSSLTest.QUEUE);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/BasicXaTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/BasicXaTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/BasicXaTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -31,6 +31,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.utils.UUIDGenerator;
@@ -268,8 +269,8 @@
ClientSession recSession = sessionFactory.createSession();
recSession.start();
ClientConsumer clientConsumer = recSession.createConsumer(atestq);
- ClientMessage m1 = createTextMessage(clientSession, "m1");
- ClientMessage m2 = createTextMessage(clientSession, "m2");
+ ClientMessage m1 = CreateMessage.createTextMessage(clientSession, "m1",
true);
+ ClientMessage m2 = CreateMessage.createTextMessage(clientSession, "m2",
true);
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
clientSession.end(xid, XAResource.TMSUSPEND);
@@ -294,7 +295,7 @@
Xid xid3 = newXID();
ClientProducer clientProducer = clientSession.createProducer(atestq);
ClientConsumer clientConsumer = clientSession.createConsumer(atestq);
- ClientMessage m1 = createTextMessage(clientSession, "m1");
+ ClientMessage m1 = CreateMessage.createTextMessage(clientSession, "m1",
true);
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
clientSession.end(xid, XAResource.TMSUCCESS);
@@ -320,10 +321,10 @@
{
Xid xid = newXID();
- ClientMessage m1 = createTextMessage(clientSession, "m1");
- ClientMessage m2 = createTextMessage(clientSession, "m2");
- ClientMessage m3 = createTextMessage(clientSession, "m3");
- ClientMessage m4 = createTextMessage(clientSession, "m4");
+ ClientMessage m1 = CreateMessage.createTextMessage(clientSession, "m1",
true);
+ ClientMessage m2 = CreateMessage.createTextMessage(clientSession, "m2",
true);
+ ClientMessage m3 = CreateMessage.createTextMessage(clientSession, "m3",
true);
+ ClientMessage m4 = CreateMessage.createTextMessage(clientSession, "m4",
true);
ClientProducer clientProducer = clientSession.createProducer(atestq);
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
@@ -362,10 +363,10 @@
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer = clientSession2.createProducer(atestq);
- ClientMessage m1 = createTextMessage(clientSession2, "m1");
- ClientMessage m2 = createTextMessage(clientSession2, "m2");
- ClientMessage m3 = createTextMessage(clientSession2, "m3");
- ClientMessage m4 = createTextMessage(clientSession2, "m4");
+ ClientMessage m1 = CreateMessage.createTextMessage(clientSession2, "m1",
true);
+ ClientMessage m2 = CreateMessage.createTextMessage(clientSession2, "m2",
true);
+ ClientMessage m3 = CreateMessage.createTextMessage(clientSession2, "m3",
true);
+ ClientMessage m4 = CreateMessage.createTextMessage(clientSession2, "m4",
true);
clientProducer.send(m1);
clientProducer.send(m2);
clientProducer.send(m3);
@@ -414,7 +415,7 @@
ClientProducer clientProducer = clientSession2.createProducer(atestq);
for (int i = 0; i < numSessions; i++)
{
- clientProducer.send(createTextMessage(clientSession2, "m" + i));
+ clientProducer.send(CreateMessage.createTextMessage(clientSession2,
"m" + i, true));
}
ClientSession[] clientSessions = new ClientSession[numSessions];
ClientConsumer[] clientConsumers = new ClientConsumer[numSessions];
@@ -684,8 +685,8 @@
for (int i = 0; i < 100; i++)
{
- prodA.send(createTextMessage(sessionA, "A" + i));
- prodB.send(createTextMessage(sessionB, "B" + i));
+ prodA.send(CreateMessage.createTextMessage(sessionA, "A" + i, true));
+ prodB.send(CreateMessage.createTextMessage(sessionB, "B" + i, true));
}
sessionA.end(xid, XAResource.TMSUCCESS);
@@ -774,7 +775,7 @@
ClientProducer prod = session.createProducer(ADDRESS);
for (int nmsg = 0; nmsg < NUMBER_OF_MSGS; nmsg++)
{
- ClientMessage msg = createTextMessage(session, "SimpleMessage" +
nmsg);
+ ClientMessage msg = CreateMessage.createTextMessage(session,
"SimpleMessage" + nmsg, true);
prod.send(msg);
}
@@ -784,7 +785,7 @@
session.start(xid, XAResource.TMRESUME);
}
- prod.send(createTextMessage(session, "one more"));
+ prod.send(CreateMessage.createTextMessage(session, "one more",
true));
prod.close();
@@ -801,7 +802,7 @@
// The Join Session will have its own queue, as it's not possible to
guarantee ordering since this
// producer will be using a different session
ClientProducer newProd =
newJoinSession.createProducer(ADDRESS.concat("-join"));
- newProd.send(createTextMessage(newJoinSession, "After Join"));
+ newProd.send(CreateMessage.createTextMessage(newJoinSession, "After
Join", true));
}
session.end(xid, XAResource.TMSUCCESS);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/XaTimeoutTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -40,6 +40,7 @@
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.TransactionOperation;
import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.UUIDGenerator;
@@ -131,10 +132,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
clientSession.setTransactionTimeout(1);
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
@@ -162,10 +163,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -232,14 +233,14 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
- ClientMessage m5 = createTextMessage("m5", clientSession);
- ClientMessage m6 = createTextMessage("m6", clientSession);
- ClientMessage m7 = createTextMessage("m7", clientSession);
- ClientMessage m8 = createTextMessage("m8", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
+ ClientMessage m7 = CreateMessage.createTextMessage("m7", clientSession);
+ ClientMessage m8 = CreateMessage.createTextMessage("m8", clientSession);
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -312,14 +313,14 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
- ClientMessage m5 = createTextMessage("m5", clientSession);
- ClientMessage m6 = createTextMessage("m6", clientSession);
- ClientMessage m7 = createTextMessage("m7", clientSession);
- ClientMessage m8 = createTextMessage("m8", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
+ ClientMessage m5 = CreateMessage.createTextMessage("m5", clientSession);
+ ClientMessage m6 = CreateMessage.createTextMessage("m6", clientSession);
+ ClientMessage m7 = CreateMessage.createTextMessage("m7", clientSession);
+ ClientMessage m8 = CreateMessage.createTextMessage("m8", clientSession);
ClientSession clientSession2 = sessionFactory.createSession(false, true, true);
ClientProducer clientProducer2 = clientSession2.createProducer(atestq);
clientProducer2.send(m1);
@@ -387,10 +388,10 @@
{
Xid xid = new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
- ClientMessage m1 = createTextMessage("m1", clientSession);
- ClientMessage m2 = createTextMessage("m2", clientSession);
- ClientMessage m3 = createTextMessage("m3", clientSession);
- ClientMessage m4 = createTextMessage("m4", clientSession);
+ ClientMessage m1 = CreateMessage.createTextMessage("m1", clientSession);
+ ClientMessage m2 = CreateMessage.createTextMessage("m2", clientSession);
+ ClientMessage m3 = CreateMessage.createTextMessage("m3", clientSession);
+ ClientMessage m4 = CreateMessage.createTextMessage("m4", clientSession);
clientSession.start(xid, XAResource.TMNOFLAGS);
clientProducer.send(m1);
clientProducer.send(m2);
@@ -455,7 +456,7 @@
for (int i = 0; i < messages.length; i++)
{
- messages[i] = createTextMessage("m" + i, clientSession);
+ messages[i] = CreateMessage.createTextMessage("m" + i,
clientSession);
}
for (int i = 0; i < clientSessions.length; i++)
{
Modified:
trunk/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java
===================================================================
---
trunk/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -28,6 +28,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.util.CreateMessage;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -84,7 +85,7 @@
ClientProducer prod = session.createProducer(address);
- ClientMessage message = createBytesMessage(session, new byte[700], true);
+ ClientMessage message = CreateMessage.createBytesMessage(session, new byte[700],
true);
for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
{
@@ -199,7 +200,7 @@
ClientProducer prod = session.createProducer(address);
- ClientMessage message = createBytesMessage(session, new byte[700], false);
+ ClientMessage message = CreateMessage.createBytesMessage(session, new byte[700],
false);
int NUMBER_OF_MESSAGES = 60000;
Added: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/CreateMessage.java
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/CreateMessage.java
(rev 0)
+++
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/CreateMessage.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -0,0 +1,50 @@
+package org.hornetq.tests.util;
+
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.jms.client.HornetQBytesMessage;
+import org.hornetq.jms.client.HornetQTextMessage;
+
+public final class CreateMessage
+{
+
+ private CreateMessage()
+ {
+ // Utility class
+ }
+
+ public static ClientMessage createTextMessage(final String s, final ClientSession
clientSession)
+ {
+ ClientMessage message = clientSession.createMessage(HornetQTextMessage.TYPE,
+ true,
+ 0,
+ System.currentTimeMillis(),
+ (byte)4);
+ message.getBodyBuffer().writeString(s);
+ return message;
+ }
+
+ public static
+ ClientMessage createBytesMessage(final ClientSession session, final byte[] b,
final boolean durable)
+ {
+ ClientMessage message = session.createMessage(HornetQBytesMessage.TYPE,
+ durable,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
+ message.getBodyBuffer().writeBytes(b);
+ return message;
+ }
+
+ public static ClientMessage createTextMessage(final ClientSession session, final
String s, final boolean durable)
+ {
+ ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
+ durable,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
+ message.getBodyBuffer().writeString(s);
+ return message;
+ }
+
+}
Modified: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java 2011-06-17
15:48:01 UTC (rev 10846)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -25,11 +25,11 @@
/**
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
+ *
* @version <tt>$Revision$</tt>
- *
+ *
*/
-public class RandomUtil
+public final class RandomUtil
{
// Constants -----------------------------------------------------
@@ -73,8 +73,8 @@
{
return Math.abs(RandomUtil.randomInt());
}
-
+
public static HornetQBuffer randomBuffer(final int size, final long... data)
{
HornetQBuffer buffer = HornetQBuffers.fixedBuffer(size + 8 * data.length);
@@ -86,29 +86,29 @@
for (int i = 0 ; i < size; i++)
{
- buffer.writeByte((byte)randomByte());
+ buffer.writeByte(randomByte());
}
return buffer;
}
-
-
+
+
public static int randomInterval(final int min, final int max)
{
return min + randomMax(max - min);
}
-
- public static int randomMax(int max)
+
+ public static int randomMax(final int max)
{
int value = randomPositiveInt() % max;
-
+
if (value == 0)
{
value = max;
}
-
+
return value;
}
Modified:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
---
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -44,8 +44,6 @@
import org.hornetq.core.server.impl.HornetQServerImpl;
import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.jms.client.HornetQBytesMessage;
-import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.spi.core.security.HornetQSecurityManagerImpl;
@@ -454,42 +452,15 @@
}
- protected ClientMessage createTextMessage(final ClientSession session, final String
s)
- {
- return createTextMessage(session, s, true);
- }
-
public String getTextMessage(final ClientMessage m)
{
m.getBodyBuffer().resetReaderIndex();
return m.getBodyBuffer().readString();
}
- protected ClientMessage createTextMessage(final ClientSession session, final String s,
final boolean durable)
- {
- ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- message.getBodyBuffer().writeString(s);
- return message;
- }
-
- protected ClientMessage createBytesMessage(final ClientSession session, final byte[]
b, final boolean durable)
- {
- ClientMessage message = session.createMessage(HornetQBytesMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- message.getBodyBuffer().writeBytes(b);
- return message;
- }
-
/**
- * Deleting a file on LargeDire is an asynchronous process. Wee need to keep looking
for a while
- * if the file hasn't been deleted yet
+ * Deleting a file on LargeDire is an asynchronous process. We need to keep looking
for a while
+ * if the file hasn't been deleted yet.
*/
protected void validateNoFilesOnLargeDir(final int expect) throws Exception
{
Modified: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java
===================================================================
---
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2011-06-17
15:48:01 UTC (rev 10846)
+++
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2011-06-17
15:50:19 UTC (rev 10847)
@@ -51,8 +51,6 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientMessage;
-import org.hornetq.api.core.client.ClientSession;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
import org.hornetq.core.client.impl.ServerLocatorImpl;
import org.hornetq.core.config.Configuration;
@@ -77,7 +75,6 @@
import org.hornetq.core.server.ServerMessage;
import org.hornetq.core.server.impl.ServerMessageImpl;
import org.hornetq.core.transaction.impl.XidImpl;
-import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.utils.UUIDGenerator;
/**
@@ -919,7 +916,6 @@
Map<Thread, StackTraceElement[]> postThreads = Thread.getAllStackTraces();
- boolean failedThread = false;
if (postThreads.size() > previousThreads.size())
{
StringBuffer buffer = new StringBuffer();
@@ -932,7 +928,6 @@
{
if (!aliveThread.getName().contains("SunPKCS11") &&
!previousThreads.containsKey(aliveThread))
{
- failedThread = true;
buffer.append("=============================================================================\n");
buffer.append("Thread " + aliveThread + " is still alive
with the following stackTrace:\n");
StackTraceElement[] elements = postThreads.get(aliveThread);
@@ -949,8 +944,6 @@
}
- //assertFalse("Thread Failed", failedThread);
-
super.tearDown();
}
@@ -1176,22 +1169,6 @@
return (size / alignment + (size % alignment != 0 ? 1 : 0)) * alignment;
}
- protected ClientMessage createTextMessage(final String s, final ClientSession
clientSession)
- {
- return createTextMessage(s, true, clientSession);
- }
-
- protected ClientMessage createTextMessage(final String s, final boolean durable, final
ClientSession clientSession)
- {
- ClientMessage message = clientSession.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)4);
- message.getBodyBuffer().writeString(s);
- return message;
- }
-
protected XidImpl newXID()
{
return new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());