Author: clebert.suconic(a)jboss.com
Date: 2010-11-10 21:23:43 -0500 (Wed, 10 Nov 2010)
New Revision: 9872
Modified:
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java
Log:
adding new test
Modified:
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
---
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2010-11-11
02:11:52 UTC (rev 9871)
+++
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2010-11-11
02:23:43 UTC (rev 9872)
@@ -113,6 +113,16 @@
public void testWithDiverts() throws Exception
{
+ internalMultiQueuesTest(true);
+ }
+
+ public void testWithMultiQueues() throws Exception
+ {
+ internalMultiQueuesTest(false);
+ }
+
+ public void internalMultiQueuesTest(final boolean divert) throws Exception
+ {
clearData();
Configuration config = createDefaultConfig();
@@ -123,28 +133,31 @@
PagingTest.PAGE_MAX,
new HashMap<String, AddressSettings>());
- DivertConfiguration divert1 = new DivertConfiguration("dv1",
- "nm1",
-
PagingTest.ADDRESS.toString(),
- PagingTest.ADDRESS.toString()
+ "-1",
- true,
- null,
- null);
+ if (divert)
+ {
+ DivertConfiguration divert1 = new DivertConfiguration("dv1",
+ "nm1",
+
PagingTest.ADDRESS.toString(),
+
PagingTest.ADDRESS.toString() + "-1",
+ true,
+ null,
+ null);
+
+ DivertConfiguration divert2 = new DivertConfiguration("dv2",
+ "nm2",
+
PagingTest.ADDRESS.toString(),
+
PagingTest.ADDRESS.toString() + "-2",
+ true,
+ null,
+ null);
+
+ ArrayList<DivertConfiguration> divertList = new
ArrayList<DivertConfiguration>();
+ divertList.add(divert1);
+ divertList.add(divert2);
+
+ config.setDivertConfigurations(divertList);
+ }
- DivertConfiguration divert2 = new DivertConfiguration("dv2",
- "nm2",
-
PagingTest.ADDRESS.toString(),
- PagingTest.ADDRESS.toString()
+ "-2",
- true,
- null,
- null);
-
- ArrayList<DivertConfiguration> divertList = new
ArrayList<DivertConfiguration>();
- divertList.add(divert1);
- divertList.add(divert2);
-
- config.setDivertConfigurations(divertList);
-
server.start();
final int messageSize = 1024;
@@ -171,10 +184,19 @@
ClientSession session = sf.createSession(false, false, false);
- session.createQueue(PagingTest.ADDRESS + "-1", PagingTest.ADDRESS +
"-1", null, true);
+ if (divert)
+ {
+ session.createQueue(PagingTest.ADDRESS + "-1",
PagingTest.ADDRESS + "-1", null, true);
- session.createQueue(PagingTest.ADDRESS + "-2", PagingTest.ADDRESS +
"-2", null, true);
+ session.createQueue(PagingTest.ADDRESS + "-2",
PagingTest.ADDRESS + "-2", null, true);
+ }
+ else
+ {
+ session.createQueue(PagingTest.ADDRESS.toString(), PagingTest.ADDRESS +
"-1", null, true);
+ session.createQueue(PagingTest.ADDRESS.toString(), PagingTest.ADDRESS +
"-2", null, true);
+ }
+
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
ClientMessage message = null;