Author: ataylor
Date: 2010-11-03 11:55:22 -0400 (Wed, 03 Nov 2010)
New Revision: 9838
Modified:
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
Log:
test fix
Modified:
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
---
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-11-03
15:32:04 UTC (rev 9837)
+++
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-11-03
15:55:22 UTC (rev 9838)
@@ -1163,6 +1163,36 @@
sfs[node] = sf;
}
+ protected void setupSessionFactory(final int node, final boolean netty, int
reconnectAttempts) throws Exception
+ {
+ if (sfs[node] != null)
+ {
+ throw new IllegalArgumentException("Already a server at " + node);
+ }
+
+ Map<String, Object> params = generateParams(node, netty);
+
+ TransportConfiguration serverTotc;
+
+ if (netty)
+ {
+ serverTotc = new TransportConfiguration(ServiceTestBase.NETTY_CONNECTOR_FACTORY,
params);
+ }
+ else
+ {
+ serverTotc = new TransportConfiguration(ServiceTestBase.INVM_CONNECTOR_FACTORY,
params);
+ }
+
+ locators[node] = HornetQClient.createServerLocatorWithoutHA(serverTotc);
+
+ locators[node].setBlockOnNonDurableSend(true);
+ locators[node].setBlockOnDurableSend(true);
+ locators[node].setReconnectAttempts(reconnectAttempts);
+ ClientSessionFactory sf = locators[node].createSessionFactory();
+
+ sfs[node] = sf;
+ }
+
protected void setupSessionFactory(final int node, final int backupNode, final boolean
netty, final boolean blocking) throws Exception
{
if (sfs[node] != null)
@@ -1184,14 +1214,14 @@
}
- ServerLocator locator = HornetQClient.createServerLocatorWithHA(serverTotc);
- locator.setRetryInterval(100);
- locator.setRetryIntervalMultiplier(1d);
- locator.setReconnectAttempts(-1);
- locator.setBlockOnNonDurableSend(blocking);
- locator.setBlockOnDurableSend(blocking);
+ locators[node] = HornetQClient.createServerLocatorWithHA(serverTotc);
+ locators[node].setRetryInterval(100);
+ locators[node].setRetryIntervalMultiplier(1d);
+ locators[node].setReconnectAttempts(-1);
+ locators[node].setBlockOnNonDurableSend(blocking);
+ locators[node].setBlockOnDurableSend(blocking);
- ClientSessionFactory sf = locator.createSessionFactory();
+ ClientSessionFactory sf = locators[node].createSessionFactory();
sfs[node] = sf;
}
Modified:
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
===================================================================
---
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java 2010-11-03
15:32:04 UTC (rev 9837)
+++
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java 2010-11-03
15:55:22 UTC (rev 9838)
@@ -41,7 +41,7 @@
try
{
- setupSessionFactory(0, isNetty());
+ setupSessionFactory(0, isNetty(), -1);
setupSessionFactory(1, isNetty());
// create some dummy queues to ensure that the test queue has a high numbered
binding
@@ -77,8 +77,6 @@
startServers(0);
- addConsumer(1, 0, "queue10", null);
-
waitForBindings(0, "queues.testaddress", 1, 1, true);
waitForBindings(1, "queues.testaddress", 1, 0, true);
@@ -89,7 +87,7 @@
sendInRange(1, "queues.testaddress", 10, 20, false, null);
- verifyReceiveAllInRange(10, 20, 1);
+ verifyReceiveAllInRange(10, 20, 0);
System.out.println("*****************************************************************************");
}
finally
@@ -121,7 +119,7 @@
try
{
- setupSessionFactory(0, isNetty());
+ setupSessionFactory(0, isNetty(), -1);
setupSessionFactory(1, isNetty());
// create some dummy queues to ensure that the test queue has a high numbered
binding